package 多线程.多线程创建.生产者消费者.同步代码块;

public class BaoZiPu {

    public int count = 0;

    private boolean flag = false;

    public BaoZiPu(int count, boolean flag) {
        this.count = count;
        this.flag = flag;
    }

    public BaoZiPu() {
    }

    public int getCount() {
        System.out.println("消费第...." + count + "个包子.");
        return count;
    }

    public void setCount() {
        count++;
        System.out.println("生产第" + count + "个包子.");
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }
}
